home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xmlextras / nsIDOMParser.h next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  190 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIDOMParser.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIDOMParser_h__
  6. #define __gen_nsIDOMParser_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIInputStream; /* forward declaration */
  18.  
  19. class nsIDOMDocument; /* forward declaration */
  20.  
  21. class nsIURI; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIDOMParser */
  25. #define NS_IDOMPARSER_IID_STR "4f45513e-55e5-411c-a844-e899057026c1"
  26.  
  27. #define NS_IDOMPARSER_IID \
  28.   {0x4f45513e, 0x55e5, 0x411c, \
  29.     { 0xa8, 0x44, 0xe8, 0x99, 0x05, 0x70, 0x26, 0xc1 }}
  30.  
  31. /**
  32.  * The nsIDOMParser interface is a non-SAX interface that can be used
  33.  * to parse a string or byte stream containing XML or HTML content
  34.  * to a DOM document. Parsing is always synchronous - a document is always
  35.  * returned from the parsing methods. This is as opposed to loading and
  36.  * parsing with the XMLHttpRequest interface, which can be used for
  37.  * asynchronous (callback-based) loading.
  38.  */
  39. class NS_NO_VTABLE nsIDOMParser : public nsISupports {
  40.  public: 
  41.  
  42.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMPARSER_IID)
  43.  
  44.   /**
  45.    * The string passed in is parsed into a DOM document.
  46.    *
  47.    * @param str The UTF16 string to be parsed
  48.    * @param contentType The content type of the string (see parseFromStream)
  49.    * @returns The DOM document created as a result of parsing the 
  50.    *          string
  51.    */
  52.   /* nsIDOMDocument parseFromString (in wstring str, in string contentType); */
  53.   NS_IMETHOD ParseFromString(const PRUnichar *str, const char *contentType, nsIDOMDocument **_retval) = 0;
  54.  
  55.   /**
  56.    * The buffer is parsed into a DOM document.
  57.    * The charset is determined from the xml entity decl.
  58.    *
  59.    * @param buf The octet array data to be parsed
  60.    * @param bufLen Length (in bytes) of the data
  61.    * @param contentType The content type of the data (see parseFromStream)
  62.    * @returns The DOM document created as a result of parsing the 
  63.    *          string
  64.    */
  65.   /* nsIDOMDocument parseFromBuffer ([array, size_is (bufLen), const] in octet buf, in PRUint32 bufLen, in string contentType); */
  66.   NS_IMETHOD ParseFromBuffer(const PRUint8 *buf, PRUint32 bufLen, const char *contentType, nsIDOMDocument **_retval) = 0;
  67.  
  68.   /**
  69.    * The byte stream passed in is parsed into a DOM document.
  70.    *
  71.    * Not accessible from web content.
  72.    *
  73.    * @param stream The byte stream whose contents are parsed
  74.    * @param charset The character set that was used to encode the byte
  75.    *                stream. NULL if not specified.
  76.    * @param contentLength The number of bytes in the input stream.
  77.    * @param contentType The content type of the string - either text/xml,
  78.    *                    application/xml, or application/xhtml+xml.
  79.    *                    Must not be NULL.
  80.    * @returns The DOM document created as a result of parsing the 
  81.    *          stream
  82.    */
  83.   /* nsIDOMDocument parseFromStream (in nsIInputStream stream, in string charset, in long contentLength, in string contentType); */
  84.   NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, PRInt32 contentLength, const char *contentType, nsIDOMDocument **_retval) = 0;
  85.  
  86.   /**
  87.    * Set/Get the baseURI, may be needed when called from native code.
  88.    */
  89.   /* [noscript] attribute nsIURI baseURI; */
  90.   NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) = 0;
  91.   NS_IMETHOD SetBaseURI(nsIURI * aBaseURI) = 0;
  92.  
  93. };
  94.  
  95. /* Use this macro when declaring classes that implement this interface. */
  96. #define NS_DECL_NSIDOMPARSER \
  97.   NS_IMETHOD ParseFromString(const PRUnichar *str, const char *contentType, nsIDOMDocument **_retval); \
  98.   NS_IMETHOD ParseFromBuffer(const PRUint8 *buf, PRUint32 bufLen, const char *contentType, nsIDOMDocument **_retval); \
  99.   NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, PRInt32 contentLength, const char *contentType, nsIDOMDocument **_retval); \
  100.   NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI); \
  101.   NS_IMETHOD SetBaseURI(nsIURI * aBaseURI); 
  102.  
  103. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  104. #define NS_FORWARD_NSIDOMPARSER(_to) \
  105.   NS_IMETHOD ParseFromString(const PRUnichar *str, const char *contentType, nsIDOMDocument **_retval) { return _to ParseFromString(str, contentType, _retval); } \
  106.   NS_IMETHOD ParseFromBuffer(const PRUint8 *buf, PRUint32 bufLen, const char *contentType, nsIDOMDocument **_retval) { return _to ParseFromBuffer(buf, bufLen, contentType, _retval); } \
  107.   NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, PRInt32 contentLength, const char *contentType, nsIDOMDocument **_retval) { return _to ParseFromStream(stream, charset, contentLength, contentType, _retval); } \
  108.   NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) { return _to GetBaseURI(aBaseURI); } \
  109.   NS_IMETHOD SetBaseURI(nsIURI * aBaseURI) { return _to SetBaseURI(aBaseURI); } 
  110.  
  111. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  112. #define NS_FORWARD_SAFE_NSIDOMPARSER(_to) \
  113.   NS_IMETHOD ParseFromString(const PRUnichar *str, const char *contentType, nsIDOMDocument **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFromString(str, contentType, _retval); } \
  114.   NS_IMETHOD ParseFromBuffer(const PRUint8 *buf, PRUint32 bufLen, const char *contentType, nsIDOMDocument **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFromBuffer(buf, bufLen, contentType, _retval); } \
  115.   NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, PRInt32 contentLength, const char *contentType, nsIDOMDocument **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFromStream(stream, charset, contentLength, contentType, _retval); } \
  116.   NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBaseURI(aBaseURI); } \
  117.   NS_IMETHOD SetBaseURI(nsIURI * aBaseURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBaseURI(aBaseURI); } 
  118.  
  119. #if 0
  120. /* Use the code below as a template for the implementation class for this interface. */
  121.  
  122. /* Header file */
  123. class nsDOMParser : public nsIDOMParser
  124. {
  125. public:
  126.   NS_DECL_ISUPPORTS
  127.   NS_DECL_NSIDOMPARSER
  128.  
  129.   nsDOMParser();
  130.  
  131. private:
  132.   ~nsDOMParser();
  133.  
  134. protected:
  135.   /* additional members */
  136. };
  137.  
  138. /* Implementation file */
  139. NS_IMPL_ISUPPORTS1(nsDOMParser, nsIDOMParser)
  140.  
  141. nsDOMParser::nsDOMParser()
  142. {
  143.   /* member initializers and constructor code */
  144. }
  145.  
  146. nsDOMParser::~nsDOMParser()
  147. {
  148.   /* destructor code */
  149. }
  150.  
  151. /* nsIDOMDocument parseFromString (in wstring str, in string contentType); */
  152. NS_IMETHODIMP nsDOMParser::ParseFromString(const PRUnichar *str, const char *contentType, nsIDOMDocument **_retval)
  153. {
  154.     return NS_ERROR_NOT_IMPLEMENTED;
  155. }
  156.  
  157. /* nsIDOMDocument parseFromBuffer ([array, size_is (bufLen), const] in octet buf, in PRUint32 bufLen, in string contentType); */
  158. NS_IMETHODIMP nsDOMParser::ParseFromBuffer(const PRUint8 *buf, PRUint32 bufLen, const char *contentType, nsIDOMDocument **_retval)
  159. {
  160.     return NS_ERROR_NOT_IMPLEMENTED;
  161. }
  162.  
  163. /* nsIDOMDocument parseFromStream (in nsIInputStream stream, in string charset, in long contentLength, in string contentType); */
  164. NS_IMETHODIMP nsDOMParser::ParseFromStream(nsIInputStream *stream, const char *charset, PRInt32 contentLength, const char *contentType, nsIDOMDocument **_retval)
  165. {
  166.     return NS_ERROR_NOT_IMPLEMENTED;
  167. }
  168.  
  169. /* [noscript] attribute nsIURI baseURI; */
  170. NS_IMETHODIMP nsDOMParser::GetBaseURI(nsIURI * *aBaseURI)
  171. {
  172.     return NS_ERROR_NOT_IMPLEMENTED;
  173. }
  174. NS_IMETHODIMP nsDOMParser::SetBaseURI(nsIURI * aBaseURI)
  175. {
  176.     return NS_ERROR_NOT_IMPLEMENTED;
  177. }
  178.  
  179. /* End of implementation class template. */
  180. #endif
  181.  
  182. #define NS_DOMPARSER_CID                            \
  183.  { /* 3a8a3a50-512c-11d4-9a54-000064657374 */       \
  184.    0x3a8a3a50, 0x512c, 0x11d4,                      \
  185.   {0x9a, 0x54, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74} }
  186. #define NS_DOMPARSER_CONTRACTID \
  187. "@mozilla.org/xmlextras/domparser;1"
  188.  
  189. #endif /* __gen_nsIDOMParser_h__ */
  190.